package com.yld.util;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

import com.yld.dto.DBDTO;

public class PropertiesUtil {
	
	
	
	public static DBDTO parseJdbcFile(){
		
		DBDTO dto = new DBDTO();
		Properties  ps= new Properties();
		try {
			ps.load(new FileInputStream(new File(OAConstant.FILENAME)));
			String user     =ps.getProperty(OAConstant.USER);
			String password =ps.getProperty(OAConstant.PASSWORD);
			String url      =ps.getProperty(OAConstant.URL);
			String driver   =ps.getProperty(OAConstant.DRIVER);
			dto.setUser(user);
			dto.setPassword(password);
			dto.setUrl(url);
			dto.setDriver(driver);
		}catch (Exception e) {
			e.printStackTrace();
		}
		
		return dto;
		
	}

}
